package com.amazon.spring8amazon.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.io.Serializable;

/**
 * AI文案记录表
 * @TableName yibai_amazon_ai_desc
 */
@TableName(value ="yibai_amazon_ai_desc")
@Data
public class YibaiAmazonAiDesc implements Serializable {
    /**
     * id
     */
    @TableId(type = IdType.AUTO)
    private Integer id;

    /**
     * publish_id
     */
    private String publishId;

    /**
     * account_id
     */
    private Integer accountId;

    /**
     * spu
     */
    private String spu;

    /**
     * 创建人
     */
    private String createdBy;

    /**
     * 创建时间
     */
    private Integer createdUnix;

    /**
     * ai类型
     */
    private String aiType;

    /**
     * 定义AI引擎 1 是chatgpt  2是gemini
     */
    private Integer aiEngine;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        YibaiAmazonAiDesc other = (YibaiAmazonAiDesc) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getPublishId() == null ? other.getPublishId() == null : this.getPublishId().equals(other.getPublishId()))
            && (this.getAccountId() == null ? other.getAccountId() == null : this.getAccountId().equals(other.getAccountId()))
            && (this.getSpu() == null ? other.getSpu() == null : this.getSpu().equals(other.getSpu()))
            && (this.getCreatedBy() == null ? other.getCreatedBy() == null : this.getCreatedBy().equals(other.getCreatedBy()))
            && (this.getCreatedUnix() == null ? other.getCreatedUnix() == null : this.getCreatedUnix().equals(other.getCreatedUnix()))
            && (this.getAiType() == null ? other.getAiType() == null : this.getAiType().equals(other.getAiType()))
            && (this.getAiEngine() == null ? other.getAiEngine() == null : this.getAiEngine().equals(other.getAiEngine()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getPublishId() == null) ? 0 : getPublishId().hashCode());
        result = prime * result + ((getAccountId() == null) ? 0 : getAccountId().hashCode());
        result = prime * result + ((getSpu() == null) ? 0 : getSpu().hashCode());
        result = prime * result + ((getCreatedBy() == null) ? 0 : getCreatedBy().hashCode());
        result = prime * result + ((getCreatedUnix() == null) ? 0 : getCreatedUnix().hashCode());
        result = prime * result + ((getAiType() == null) ? 0 : getAiType().hashCode());
        result = prime * result + ((getAiEngine() == null) ? 0 : getAiEngine().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", publishId=").append(publishId);
        sb.append(", accountId=").append(accountId);
        sb.append(", spu=").append(spu);
        sb.append(", createdBy=").append(createdBy);
        sb.append(", createdUnix=").append(createdUnix);
        sb.append(", aiType=").append(aiType);
        sb.append(", aiEngine=").append(aiEngine);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}